package com.xx.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.xx.common.PagePo;
import com.xx.entity.ChatRoomMember;
import com.xx.mapper.ChatRoomMemberMapper;
import com.xx.pojo.po.ChatRoomMemberPo;
import com.xx.service.ChatRoomMemberService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lotey
 * @since 2024-04-21 18:12
 */
@Service
public class ChatRoomMemberServiceImpl extends ServiceImpl<ChatRoomMemberMapper, ChatRoomMember> implements ChatRoomMemberService {

    @Override
    public PageInfo<ChatRoomMember> queryPage(ChatRoomMemberPo po, PagePo pagePo) {
        PageHelper.startPage(pagePo.getPage(), pagePo.getLimit());
        LambdaQueryWrapper<ChatRoomMember> queryWrapper = new LambdaQueryWrapper<>();
        if (StringUtils.isNotEmpty(po.getName())) {
            queryWrapper.like(ChatRoomMember::getName, po.getName());
        }
        List<ChatRoomMember> studentList = list(queryWrapper);
        return new PageInfo<>(studentList);
    }

    @Override
    public List<ChatRoomMember> findList(long roomId) {
        return null;
    }

    @Override
    public void add(ChatRoomMember ChatRoomMember) {

    }

    @Override
    public void remove(ChatRoomMember ChatRoomMember) {

    }

    @Override
    public void pushEvent(ChatRoomMember ChatRoomMember, String action) {

    }
}
